home *** CD-ROM | disk | FTP | other *** search
- <HTML><BODY>
- <%
- ' Method: IsDirExists(strDirPathName)
- ' Method: IsFileExists(strFilePathName)
- ' output: 1 succeed
- ' 0 not exists
- ' -1 not exists, error
-
- ' Sample Operation:
- ' Real path on server is D:\inetpub\wwwroot\
-
- ' This file is provided as part of ASP Power Widgets Samples
- '
- ' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT
- ' WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
- ' INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES
- ' OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
- ' PURPOSE.
-
- ' Copyright 1997-1998. All rights reserved.
- ' Dalun Software Inc. ASP Power Widgets
- ' http://www.dalun.com
- ' http://members.tripod.com/ActiveServerPage/
-
- sDirPathName = Server.MapPath("/")
-
- response.write "Directory """ & sDirPathName & """<br>"
-
- Set oFDMgt = Server.CreateObject("ASPPW.FDMgt")
- iReturnCode = oFDMgt.IsDirExists (sDirPathName)
-
- select case iReturnCode
- case 1: response.write sDirPathName & " exists.<br>"
- case 0,-1: response.write sDirPathName & " not exists.<br>"
- end select
-
- if oFDMgt.GetLastErrNum <> 0 then
- response.write oFDMgt.GetLastErrDescription
- end if
-
- Set oFDMgt =nothing
-
- 'Method: IsFileExists(strFilePathName)
- '
- 'The sample directory's URL is 202.92.0.1/root/dirfileexists.asp
- 'Real path on server is D:\inetpub\wwwroot\dirfileexists.asp
- 'Delete directory "sample" and its all files and directories.
-
- sDir = "dirfileexists.asp"
- sFilePathName = Server.MapPath("/") & "\" & sDir
-
- response.write "File """ & sFilePathName & """<br>"
-
- Set oFDMgt = Server.CreateObject("ASPPW.FDMgt")
- iReturnCode = oFDMgt.IsFileExists (sFilePathName)
-
- select case iReturnCode
- case 1: response.write sFilePathName & " exists."
- case 0,-1: response.write sFilePathName & " not exists."
- end select
-
- if oFDMgt.GetLastErrNum <> 0 then
- response.write oFDMgt.GetLastErrDescription
- end if
- Set oFDMgt =nothing
-
- %>
- </BODY></HTML>
-
-
-
-
-
-